package com.dhsc.domain.yypt;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;

@Data
public class HttpRequestObj
{
	/*http请求的方法（rest方式有6中）*/
	public String method = "get";
	/*http请求的url,get请求的参数拼接成完整的url*/
	public String url = "";
	/*请求头参数*/
	public Map<String, Object> reqHeads = new HashMap<>();
	/*报文类型 参考HttpMsgType枚举类*/
	private int type;
	/*请求体（当http报文类型为raw时才启动该参数）*/
	private String bodyStr = "";
	/*请求体（当http报文类型为form表单时才启用该参数）*/
	private Map<String, Object> bodyKV = new HashMap<>();

	private Map<String,Object> cookie;
	
	public enum HttpMsgType
	{
		/*没有报文体*/
		None(0, "none"),
		/*报文为form-urlencoded格式*/
		FORMURLENCODED(1, "form-urlencoded"),
		/*报文为raw json 格式*/
		RAWJSON(2,"raw-json");
		private int i;
		private String name;
		private HttpMsgType(int i,String name)
		{
			this.i=i;
			this.name=name;
		}
		
		public String getName()
		{
			return name;
		}
		
		public int getVal() 
		{
			return i;
		}
	}
}
